//
//  MyLoanCell.m
//  MRBang
//
//  Created by 铅笔 on 16/5/12.
//  Copyright © 2016年 杭州易网新科技. All rights reserved.
//

#import "MyLoanCell.h"

@interface MyLoanCell ()

@property (nonatomic,strong) UILabel *label_bankName;//银行名
@property (nonatomic,strong) UILabel *label_detailText;//详细小字
@property (nonatomic,strong) UILabel *label_status;//状态

@end

@implementation MyLoanCell

- (instancetype) initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self initWithMyLoanCellSubviews];
    }
    return self;
}

- (void) initWithMyLoanCellSubviews
{
    //银行名
    self.label_bankName = [[UILabel alloc] initWithFrame:CGRectMake(48*PROPORTION_WIDTH, 30*PROPORTION_WIDTH, kScreenWidth-80, 20)];
    [self addSubview:self.self.label_bankName];
    self.label_bankName.font = [UIFont systemFontOfSize:24*PROPORTION_WIDTH];
    self.label_bankName.textColor = [BaseViewController colorWithHexString:@"#010101"];
    
    //detail
    self.label_detailText = [[UILabel alloc] initWithFrame:CGRectMake(self.label_bankName.frame.origin.x, self.label_bankName.frame.origin.y+self.label_bankName.frame.size.height, self.label_bankName.frame.size.width, 30)];
    [self addSubview:self.self.label_detailText];
    self.label_detailText.font = [UIFont systemFontOfSize:18*PROPORTION_WIDTH];
    self.label_detailText.textColor = [BaseViewController colorWithHexString:@"#666666"];
    
    //uilabel
    self.label_status =  [[UILabel alloc] initWithFrame:CGRectMake(kScreenWidth-130*PROPORTION_WIDTH, self.label_bankName.frame.origin.y+self.label_bankName.frame.size.height-8, 130*PROPORTION_WIDTH,20*2*PROPORTION_WIDTH)];
    [self addSubview:self.label_status];
    self.label_status.font = [UIFont systemFontOfSize:22*PROPORTION_WIDTH];

}

- (void) initWithCarRecordModel:(MyLoanModel *)modelValue
{
    self.label_bankName.text = @"";
    self.label_detailText.text = @"";
    
    if (modelValue.loanname) {
       self.label_bankName.text = modelValue.loanname;
    }
    
    self.label_detailText.text = [NSString stringWithFormat:@"金额:%@     期数:%@    利息:%@",modelValue.prince,modelValue.period,modelValue.poundage];
    
    if ([modelValue.status intValue] == 2) {
        //2  已放款 1 审核中
        self.label_status.text = @"已放款";
    }
    else
    {
       self.label_status.text = @"审核中";
    }
    
}

@end
